home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1995 November
/
EnigmA AMIGA RUN 02 (1995)(G.R. Edizioni)(IT)[!][issue 1995-11][Skylink CD].iso
/
earcd
/
util
/
text
/
megaed12.lha
/
MegaEdV1_2
/
Trans
/
BLink6.7.trans.p
< prev
next >
Wrap
Text File
|
1992-09-02
|
2KB
|
123 lines
PROGRAM PCQTrans;
{
Konvertiert BLink-Fehlerdateien für MegaEd
von Wurzelsepp, 100% PD
}
{$I "include:exec/memory.i" }
{$I "include:libraries/dosextens.i" }
{$I "include:utils/Stringlib.i" }
CONST
file1 : String = "T:MegaEdMake-ErrFile";
file2 : String = "T:MegaEdMake-Errors";
size : String = "S";
ret : Char = CHR(10);
esc2 : Char = CHR($9b);
esc : Char = CHR(27);
ver_text : String = "\0$VER: MegaEd-TransBLink V1.0 (21.03.95)";
VAR
fileh : FileHandle;
las,
len,
dummy : INTEGER;
ansi : BOOLEAN;
old : Address;
oldoff : Char;
off : ^Char;
PROCEDURE TickleOn;
BEGIN
Inc(las);
off:=Address(Integer(off)+1);
END;
BEGIN
IF DeleteFile(file2) THEN ;
fileh:=DOSOpen (file1,MODE_OLDFILE);
IF fileh<>NIL THEN
BEGIN
dummy:=Seek(fileh,0,OFFSET_END);
len:=Seek(fileh,0,OFFSET_BEGINNING);
if len>0 THEN
BEGIN
old:=AllocMem (len,MEMF_PUBLIC+MEMF_CLEAR);
IF old=NIL THEN
BEGIN
DOSClose (fileh);
Exit;
END;
IF DOSRead(fileh,old,len)<>len THEN
BEGIN
FreeMem(old,len);
DOSClose(fileh);
Exit;
END;
END;
DOSClose(fileh);
IF (len=0) THEN Exit;
fileh:=DOSOpen (file2,MODE_NEWFILE);
IF fileh<>NIL THEN
BEGIN
las:=0;
off:=old;
dummy:=0;
WHILE (las<len) AND (dummy<4) DO
BEGIN
IF off^=ret THEN Inc(dummy);
TickleOn;
END;
IF las<len THEN
BEGIN
IF off^<>ret THEN
BEGIN
ansi:=FALSE;
oldoff:=ret;
WHILE (las<len) AND ((oldoff<>ret) OR (off^<>ret)) DO
BEGIN
IF (off^=esc) OR (off^=esc2) THEN ansi:=TRUE;
IF ansi=FALSE THEN
dummy:=DOSWrite (fileh,off,1)
ELSE
IF off^='m' THEN ansi:=FALSE;
oldoff:=off^;
TickleOn;
END;
END
ELSE
BEGIN
TickleOn;
dummy:=1;
WHILE (dummy<38) AND (las<len) DO
BEGIN
Inc(dummy);
TickleOn;
END;
IF (las<len) THEN
BEGIN
dummy:=DOSWrite (fileh,size,StrLen(size));
WHILE (off^<>' ') AND (las<len) DO
BEGIN
dummy:=DOSWrite (fileh,off,1);
TickleOn;
END;
END;
END;
END;
DOSClose (fileh);
END;
FreeMem(old,len);
END;
END.